/**
 * @author 黄波
 * 创建日期：2011Sep 4, 2011
 * TODO// N/A
 */
package com.platform.manager.action;

import java.util.List;

import com.platform.manager.bo.PowerBo;
import com.platform.manager.bo.UserGroupBo;
import com.platform.pojo.Power;
import com.platform.pojo.UserGroup;

//加载所有用户组与所有权限信息，用于配置用户组权限
public class LoadUserGroupsAction extends ManagerSupport {

	private List<UserGroup> groups;
	private List<Power> powers;
	private String nodeId;
	private String nodeText;

	/**
	 * @return the nodeId
	 */
	public String getNodeId() {
		return nodeId;
	}

	/**
	 * @param nodeId the nodeId to set
	 */
	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	/**
	 * @return the nodeText
	 */
	public String getNodeText() {
		return nodeText;
	}

	/**
	 * @param nodeText the nodeText to set
	 */
	public void setNodeText(String nodeText) {
		this.nodeText = nodeText;
	}

	public List<UserGroup> getGroups() {
		return groups;
	}

	public void setGroups(List<UserGroup> groups) {
		this.groups = groups;
	}

	public void setPowers(List<Power> powers) {
		this.powers = powers;
	}

	public List<Power> getPowers() {
		return powers;
	}

	@Override
	public String execute() throws Exception {
		UserGroupBo bo = new UserGroupBo();
		groups = bo.getUserGroups();
		PowerBo powerBo = new PowerBo();
		powers = powerBo.getPowers();
		nodeText = new String(nodeText.getBytes("iso-8859-1"), "utf-8");
		return SUCCESS;
	}
	
}
